WalkerCryptoTest.SimpleAESEncryptionTest
Encrypts a string using SimpleAESEncryption.Encrypt and decrypts with SimpleAESEncryption.Decrypt before doing the same with the async methods and a tracking method
public async Task<string> SimpleAESEncryptionTest()
{
var password = "ShadowLord".ToSecureData();
var encryptasynctest = SimpleAESEncryption.Encrypt("This is a test string.", password);
Console.WriteLine("Encrypted string (SimpleAESEncryptionTest): " + encryptasynctest);
Console.WriteLine(encryptasynctest.IV);
Console.WriteLine(encryptasynctest.EncryptedText);
var decryptasynctest = SimpleAESEncryption.Decrypt(encryptasynctest, password);
Console.WriteLine("Decrypted string (SimpleAESEncryptionTest): " + decryptasynctest);
double progressPercentage = 0.0;
var enctest1 = await AsyncAESEncryption.EncryptAsync("This is a test string.", password, progress =>
{
progressPercentage = progress;
Console.WriteLine("Progress: " + progressPercentage + "%");
});
Console.WriteLine("Encrypted string (SimpleAESEncryptionTest): " + enctest1);
var decryptPercentage = 0.0;
var dectest1 = await AsyncAESEncryption.DecryptAsync(enctest1, password, progress =>
{
decryptPercentage = progress;
Console.WriteLine("Decryption Progress: " + decryptPercentage + "%");
});
Console.WriteLine("Decrypted string(SimpleAESEncryptionTest): " + dectest1);
Console.WriteLine(Environment.NewLine);
Console.WriteLine(Environment.NewLine);
return "Done";
}